namespace Redis_demo.Result;

public class Result<T>
{
    public bool Success { get; set; }
    public T Data { get; set; }
    public string ErrorMessage { get; set; }

    public static Result<T> Fail(string errorMessage)
    {
        return new Result<T>
        {
            Success = false,
            ErrorMessage = errorMessage
        };
    }

    public static Result<T> SuccessRT(T data)
    {
        return new Result<T>
        {
            Success = true,
            Data = data
        };
    }

}
